#-*-encoding=utf8-*-
from flask import Flask
from flask import render_template
import json

app = Flask(__name__)

#@app.route('/')
#def hello world():
#  return 'hello world!'

@app.route("/")
def sayHello():
    return "直接返回字符"

@app.route("/view")
def renderView():
    return render_template("index.html", name="0shiwu")

@app.route("/ajax")
def ajaxView():
    return render_template("ajax.html")

@app.route("/ajax-demo")
def ajaxDemo():
    return json.dump(dict(msg="this is ajax demo"))

if __name__ == '__main__':
  app.run()
